home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 November / EnigmA AMIGA RUN 02 (1995)(G.R. Edizioni)(IT)[!][issue 1995-11][Skylink CD].iso / earcd / program / misc / tri14dev.lha / Triton / Developer / LibSource / OpenTriton.c < prev    next >
C/C++ Source or Header  |  1995-08-25  |  2KB  |  85 lines

  1. /*
  2.  *  Triton - The object oriented GUI creation system for the Amiga
  3.  *  Written by Stefan Zeiger in 1993-1994
  4.  *
  5.  *  (c) 1993-1994 by Stefan Zeiger
  6.  *  You are hereby allowed to use this source or parts
  7.  *  of it for creating programs for AmigaOS which use the
  8.  *  Triton GUI creation system. All other rights reserved.
  9.  *
  10.  */
  11.  
  12.  
  13. #include "triton_lib.h"
  14.  
  15.  
  16. struct Library *TritonBase;
  17. struct TR_App *__Triton_Support_App;
  18.  
  19.  
  20. /****** triton.lib/TR_OpenTriton ******
  21. *
  22. *   NAME    
  23. *    TR_OpenTriton -- Opens Triton ready to use.
  24. *
  25. *   SYNOPSIS
  26. *    success = TR_OpenTriton(version, tag1,...)
  27. *    D0
  28. *
  29. *    BOOL TR_OpenTriton(ULONG, ULONG,...);
  30. *
  31. *   FUNCTION
  32. *    Opens triton.library with the specified minimum
  33. *    version and creates an application.
  34. *    The supplied tags are passed as a taglist to
  35. *    TR_CreateApp().
  36. *
  37. *   RESULT
  38. *    success - Was everything opened successful?
  39. *
  40. *   SEE ALSO
  41. *    TR_CloseTriton(), TR_CreateApp()
  42. *
  43. ******/
  44.  
  45. BOOL __stdargs TR_OpenTriton(ULONG version, ULONG taglist,...)
  46. {
  47.   if(!(TritonBase=OpenLibrary(TRITONNAME,version))) return FALSE;
  48.   if(!(__Triton_Support_App=TR_CreateApp((struct TagItem *)&taglist))) return FALSE;
  49.   return TRUE;
  50. }
  51.  
  52.  
  53. /****** triton.lib/TR_CloseTriton ******
  54. *
  55. *   NAME    
  56. *    TR_CloseTriton -- Closes Triton easily.
  57. *
  58. *   SYNOPSIS
  59. *    TR_CloseTriton()
  60. *
  61. *    VOID TR_CloseTriton(VOID);
  62. *
  63. *   FUNCTION
  64. *    Closes the application created by OpenTriton()
  65. *    and closes triton.library.
  66. *
  67. *   SEE ALSO
  68. *    TR_OpenTriton()
  69. *
  70. ******/
  71.  
  72. VOID __regargs TR_CloseTriton(VOID)
  73. {
  74.   if(__Triton_Support_App)
  75.   {
  76.     TR_DeleteApp(__Triton_Support_App);
  77.     __Triton_Support_App=NULL;
  78.   }
  79.   if(TritonBase)
  80.   {
  81.     CloseLibrary(TritonBase);
  82.     TritonBase=NULL;
  83.   }
  84. }
  85.